package icu.cocoon.work.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import icu.cocoon.dao.base.BaseIService;
import icu.cocoon.work.entity.WechatArticle;
import icu.cocoon.work.entity.dto.WechatArticleDTO;
import icu.cocoon.work.pojo.param.StudyInfoParam;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Cocoon
 * @since 2020-07-30
 */
public interface WechatArticleService extends BaseIService<WechatArticle> {


  /**
   * 分享文章
   * @param token 薪税学院token
   * @param id 文章id
   * @return map
   * @throws JsonProcessingException
   */
  Map shareArticle(String token, Long id) throws JsonProcessingException;

  /**
   * 根据关键字爬取文章
   * @param page 页码
   * @param keyword 关键字
   * @param token 微信token
   * @param cookie 微信cookie
   * @return WechatArticleDTO
   * @throws UnsupportedEncodingException
   */
  List<WechatArticleDTO> getWechatArticleDTOList(int page, String keyword, String token, String cookie)
      throws UnsupportedEncodingException;

  void save(StudyInfoParam param);
}
